local tuigong = fk.CreateSkill({
    name = "sj5__tuigong",
  })
  
  Fk:loadTranslationTable{
    ["sj5__tuigong"] = "推弓",
    [":sj5__tuigong"] = "出牌阶段限一次，你可以将攻击范围调整至1~5。",

    ["#sj5__tuigong"] = "推弓：你可以将攻击范围调整至1~5",
    ["@sj5__tuigong"] = "推弓",
  
   ["$sj5__tuigong1"] = "箭阵开道，所向披靡！",
   ["$sj5__tuigong2"] = "哪里逃，看箭！",
  }

  tuigong:addEffect("active", {
    prompt = "#sj5__tuigong",
    interaction = function()
     return UI.Spin {
       from = 1,
       to = 5,
       default = 1
     }
   end,
   can_use = function(self, player)
     return player:usedSkillTimes(tuigong.name, Player.HistoryPhase) < 1
   end,
   on_use = function(self, room, effect)
     local player = effect.from
     room:setPlayerMark(player, "@sj5__tuigong", self.interaction.data)
   end,
  })

  --修改这个方法，获取除调用方法以外的所有范围技能，达到令攻击范围不受装备，技能的影响(既锁定攻击范围)
  --- 获取玩家攻击范围。
---@return integer
local getAttackRange_suoding = function (player,self)
  local baseValue = 1

  local weapons = table.filter(player:getEquipments(Card.SubtypeWeapon), function (id)
    local weapon = Fk:getCardById(id) ---@class Weapon
    return weapon:AvailableAttackRange(player)
  end)
  if #weapons > 0 then
    baseValue = 0
    for _, id in ipairs(weapons) do
      local weapon = Fk:getCardById(id) ---@class Weapon
      baseValue = math.max(baseValue, weapon:getAttackRange(player) or 1)
    end
  end

  local status_skills = Fk:currentRoom().status_skills[AttackRangeSkill] or Util.DummyTable ---@type AttackRangeSkill[]
  local max_fixed, correct = nil, 0
  for _, skill in ipairs(status_skills) do
    if skill ~= self then  --仅增加这一句代码，避免递归
      local final = skill:getFinal(self)
      if final then -- 目前逻辑，发现一个终值马上返回
        return math.max(0, final)
      end
      local f = skill:getFixed(self)
      if f ~= nil then
        max_fixed = max_fixed and math.max(max_fixed, f) or f
      end
      local c = skill:getCorrect(self)
      correct = correct + (c or 0)
    end
  end

  return math.max(math.max(baseValue, (max_fixed or 0)) + correct, 0)
end

  tuigong:addEffect("atkrange", {
    correct_func = function (self, from, to)
      if from:getMark("@sj5__tuigong") > 0 then -- 没标记代表没发动技能，不锁定攻击范围
        local num = - getAttackRange_suoding(from,self) --获取玩家攻击范围，转为负值后用于归0
        return num + from:getMark("@sj5__tuigong") --将所有除本技能以外的所有影响范围的因素计算后归0，再设置为推弓的数量
      end
    end,
  })

  return tuigong